from lib.getsession import GetSession
from config.Configuration import host_port

class NoticeApi:
    def __init__(self):
        self.session = GetSession.get_session()

    #新增公告
    def Add_Notice(self, title, content):
        url = f'http://{host_port}/WoniuBoss4.0/notice/doAdd'
        headres = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
        payload = {'title': title, 'content': content}
        r = self.session.post(url,headers=headres, data=payload)
        return r.text